<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class PeeModel extends Model
{
    //考研信息
    protected $table = 'pee_info';   //数据表
    protected $pk = 'pee_id';  //主键

    protected $schema=[
        'pee_id' => 'int',
        'admin_id' => 'int',
        'pee_category' => 'int',
        'pee_title' => 'string',
        'pee_content' => 'string',
        'pee_label' => 'string',
        'pee_source' => 'string',
        'pee_ctr' => 'int',
        'pee_release_time'=>'datetime'

    ];

    protected $createTime = 'pee_release_time';

//    protected static function init()
//    {
//        echo '初始化 Pee 模型';
//    }

    public static function getAllPeeInfo()
    {
        return PeeModel::field('pee_id,pee_category,pee_title,pee_content,pee_label,pee_source,pee_ctr,pee_release_time')->select();
    }

    public static function getPeeByPeeId($pee_id)
    {
        return PeeModel::where('pee_id',$pee_id)->find();
    }

}
